package com.vini.core.ec;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "travels", catalog = "hopon")
public class Travel implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Long id;
	private String travelType;
	private User user;
	
	public Travel(String travelType) {
		this.travelType = travelType;
	}
	@Id
	@Column(name = "Travels_Id", unique = true, nullable = false)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name = "Travels_Type", nullable = false)
	public String getTravelType() {
		return travelType;
	}
	public void setTravelType(String travelType) {
		this.travelType = travelType;
	}
	
	public static List<Travel>getTravels(){
		return Arrays.asList(new Travel("Consumer"),new Travel("Provider"),new Travel("Both"),new Travel("Taxi"));
	}
	@ManyToOne(cascade = CascadeType.ALL)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
